<?
//define('IN_INDEX', TRUE);

session_start();

include('./../config/db_settings.php');
include('pms_inc.php');

$user = $_SESSION[$settings['session_prefix'].'user_id'];

    
//Are they logged in or not?
if(!$user)
	{
	echo "";
	}

else
	{
	if(mysql_error()==""){
		//Get your unread private message count
		$sql = mysql_query ("SELECT count(*) new_pm_count FROM ".$db_settings['messages_table']." WHERE received = '0' and receiver_id = '$user'");
		$row = mysql_fetch_array ($sql);
		$new_pm_count = $row['new_pm_count'];
		if($new_pm_count==0){
			//no new message
			echo "";
		}else{
			//have new message(s)
			echo "<img src='./templates/". $settings['template'] ."/images/email.png'>";
		}
	}else
	{
		echo "";
	}
	
	//This ends that first thing that checks if you are logged in or not
	}
?>

